home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 163_02 / ungetc.c < prev   
Text File  |  1988-01-30  |  384b  |  11 lines

  1. /*
  2. ** push a character back into an input stream
  3. */
  4. #include <streamio.h>
  5.  
  6. ungetc(c, stream) char c; int *stream; {
  7.   if(stream[_IOB_FLAG]&_UNGET) return EOF;
  8.   stream[_IOB_FLAG]=(stream[_IOB_FLAG]&255)|(c<<8)|_UNGET;
  9.   return c&255;
  10.   }
  11.